<?php

class Model_Hr_Traineelog extends Zend_Db_Table_Abstract {

	protected $_name = 'staff_trainee_log';
	
	public function getTraineelog( $idLog){
		
		$row = $this->fetchRow("`id_log` = ". $idLog);
		if(!$row) return false;
		return $row->toArray();		
		
		}
		
	public function addTraineelog( $idStaff , $idManager , $actionDate , $actionTime , $action){
		
		$data = array(
			
         "id_staff" =>  $idStaff ,
         "id_manager" =>  $idManager ,
         "action_date" =>  $actionDate ,
         "action_time" =>  $actionTime ,
         "action" =>  $action 
	
			);
		$this->insert($data);
		
		}
		
	public function updateTraineelog(  $idLog ,  $idStaff , $idManager , $actionDate , $actionTime , $action){
		$data = array(
			
         "id_staff" =>  $idStaff ,
         "id_manager" =>  $idManager ,
         "action_date" =>  $actionDate ,
         "action_time" =>  $actionTime ,
         "action" =>  $action 
	
			);
			
		$this->update($data,"`id_log` = ". $idLog);
		}
		
	public function deleteTraineelog( $idLog){
		
		$this->delete("`id_log` = ". $idLog);
		
		}	
	
	public function listAll(){
		
		$rows =$this->fetchAll("1","id_log DESC ");
		if(!$rows) return false;
		return $rows->toArray();			
		
		}	
}


?>